import axios from '@/libs/axios1';
let headers = { 'content-type': 'application/json;charset=UTF-8' };

// 查询用户课程统计情况
export const getCourseStatistics = (params) => {
    return axios({
        url: `/self-study/mycourse/statistics/statisticCourseHome`,
        method: 'get',
        headers,
        params
    });
};

// 查询用户课件统计情况
export const getExpStatistics = (params) => {
    return axios({
        url: `/self-study/mycourse/statistics/statisticExpHome`,
        method: 'get',
        headers,
        params
    });
};

// 查询用户考试统计情况
export const getExamStatistics = (params) => {
    return axios({
        url: `/self-study/exam/examination/statisticsByUser/${params.userId}`,
        method: 'get',
        headers,
        params
    });
};

// 查询用户技能树统计情况
export const getTreeStatistics = (params) => {
    return axios({
        url: `/self-study/studentIntegral/statistic/careerSkillScore/${params.userId}`,
        method: 'get',
        headers,
        params
    });
};

// 查询用户场景统计情况
export const getSceneStatistics = (params) => {
    return axios({
        url: `/compete/contest/statistic/details/${params.userId}/${params.type}`,
        method: 'get',
        headers,
        params
    });
};

// 查询用户场景统计情况new
export const newGetSceneStatistics = (params) => {
    return axios({
        url: `/self-study/studentIntegral/statistic/details/${params.userId}/${params.type}`,
        method: 'get',
        headers,
        params
    });
};
/**
 * 创建优秀学员
 * @param {*} data
 * @returns
 */
export const addExcellentStudent = (ids) => {
    return axios({
        url: `/self-study/studentIntegral/addOrCancelOutstandingStudents?action=true`,
        method: 'post',
        headers,
        data: ids
    });
};

/**
 * 删除优秀学员
 * @param {*} id
 * @returns
 */
export const deleteExcellentStudent = (id) => {
    return axios({
        url: `/self-study/studentIntegral/addOrCancelOutstandingStudents?action=false`,
        method: 'post',
        headers,
        data: [id]
    });
};

/**
 * 查询有锚定的课件
 * @param {*} params
 * @returns
 */
export const getLearnNoteList = (params) => {
    return axios({
        url: `/self-study/exp/learnNotes/resPages`,
        method: 'get',
        headers,
        params
    });
};

/**
 * 获取学员列表
 * @param {*} params
 * @returns
 */
export const getStudentList = (params) => {
    return axios({
        url: `/self-study/studentIntegral/queryStudentIntergPage`,
        method: 'get',
        headers,
        params
    });
};

/**
 * 获取学员的积分列表
 * @param {*} params
 * @returns
 */
export const getIntegralList = (params) => {
    return axios({
        url: `/self-study/studentIntegral/queryUserScoreRecord/${params.userId}`,
        method: 'get',
        headers,
        params
    });
};

/**
 * 获取学员的勋章列表
 * @param {*} params
 * @returns
 */
export const getMedalList = (userId) => {
    return axios({
        url: `/self-study/studentIntegral/queryUserIntegralMedal/${userId}`,
        method: 'get',
        headers
    });
};

//获取当前用户学过的所有课件和课程
export const queryRecordByUid = (params, data) => {
    return axios({
        url: `/self-study/mycourse/studyRecord/list`,
        method: 'post',
        headers,
        params,
        data
    });
};

export const shareNote = (data) => {
    return axios({
        url: `/self-study/exp/share`,
        method: 'post',
        headers,
        data
    });
};
export const batchShareNote = (data) => {
    return axios({
        url: `/self-study/exp/share/addList`,
        method: 'post',
        headers,
        data
    });
};
export const cancelShareNote = (data) => {
    return axios({
        url: `/self-study/exp/share`,
        method: 'delete',
        headers,
        data
    });
};
export const queryShareList = (params,creator) => {
    return axios({
        url: `/self-study/exp/share/${creator}`,
        method: 'get',
        headers,
        params
    });
};

// 锚定分享查询
export const querYanchoringShareList = (params) => {
    return axios({
        url: `/self-study/exp/share/getNotesShare`,
        method: 'get',
        headers,
        params
    });
};

// 判断分享按钮是否可点击
export const shareCanClick = (params,data) => {
    return axios({
        url: `/self-study/exp/share/canClick`,
        method: 'post',
        headers,
        params,
        data
    });
};